﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MyMES.IServices.Holidayes;
using System.Threading.Tasks;
using VOL.Core.Utilities.Response;
using VOL.Entity.DomainModels;

namespace VOL.WebApi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class HolidaysController : ControllerBase
    {
        private readonly IHolidaysServices _schedulingManagementServices;

        public HolidaysController(IHolidaysServices schedulingManagementServices)
        {
            _schedulingManagementServices = schedulingManagementServices;
        }

        [HttpGet]
        public Task<WebResponseContent> GetHolidays()
        {
            return _schedulingManagementServices.GetHolidays();
        }
        [HttpPost]
        public async Task<WebResponseContent> CreateUpdateHolidays([FromBody] Holidays holidays)
        {
            return await _schedulingManagementServices.CreateUpdateHolidays(holidays);
        }
    }
}
